package stream流第一遍.demo04;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/5 20:03
 */

public class Test {
    public static void main(String[] args) {
        String[] arr1={"只","因","你"};
        String[] arr2={"太","太", "没"};
        Stream<String> haha = Stream.of(arr1);
        Stream<String> hehe = Stream.of(arr2);
        //合并流
      // Stream.concat(haha, hehe).forEach(System.out::println);

        //流去重
       // Stream.concat(haha,hehe).distinct().forEach(System.out::println);

        //限制获取前n个元素
       // Stream.concat(haha,hehe).limit(2).forEach(System.out::println);

        //跳过前几个元素
        Stream.concat(haha,hehe).skip(2).forEach(System.out::println);
    }

}



